<%@ page import="com.shop.service.ICourseService" %>
<%@ page import="com.shop.service.CourseService" %>
<%@ page import="com.shop.model.Course" %>
<%@ page import="java.util.List" %>
<%@ page import="com.shop.service.IOrderService" %>
<%@ page import="com.shop.service.OrderService" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025/6/8
  Time: 上午10:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>我的课程</title>
    <style>
        /* 添加一些基本的样式 */
        table {
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            border: 1px solid black;
            padding: 8px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
    </style>
</head>
<body>
<h1>我的课程</h1>
<%
    String teacherId = request.getParameter("teacherId");
    IOrderService iOrderService = new OrderService();
    List<Course> courses = iOrderService.getCourses(teacherId);
%>
<table>
    <tr>
        <th>课程名称</th>
        <th>所属类型</th>
        <th>教课老师</th>
        <th>开课时间</th>
        <th>结课时间</th>
        <th>操作</th>
    </tr>
    <% for (Course course : courses) { %>
    <tr>
        <td><%=course.getCourseName()%></td>
        <td><%=course.getType()%></td>
        <td><%=course.getTeacher()%></td>
        <td><%=course.getStartDate()%></td>
        <td><%=course.getEndDate()%></td>
        <td>
            <a href="course_study.jsp?courseId=<%=course.getCourseId()%>&studentId=<%=studentId%>">前往学习</a>
        </td>
    </tr>
    <% } %>
</table>
</body>
</html>
